package com.boot.ys.mybatisplus.controller;

import com.boot.ys.mybatisplus.common.ServiceException;
import com.boot.ys.mybatisplus.entity.Abc;
import com.boot.ys.mybatisplus.service.AbcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * 这个类是我专门用来做测试的类
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    private AbcService abcService;


    @RequestMapping("/getHttpUrl")
    public String getHttpUrl(){

        if (true){
            throw new ServiceException("已售馨");
        }

        String a = "{'age':'123'}";

        ConcurrentMap concurrentMap = new ConcurrentHashMap();


        System.out.println("测试码云");

        return a;
    }

    //批量循环插入
    @GetMapping("/insertList")
    public void insertList(@RequestBody Abc abc){

        String array = abc.getArray();


        abcService.insertList(array);



    }




}
